export default{
	data: {
		tabbar:{
			current: 0,
			color: '#444',
			activeColor: '#2d8cf0',
			items: [
				{
					icon: '\ue760',
					text: '首页',
					path: '/pages/index/index'
				},{
					icon: '\ue727',
					text: '购物',
					path: '/pages/navigation/tabbar/index2'
				},{
					icon: '\ue762',
					text: '游戏',
					path: '/pages/navigation/tabbar/index3'
				},{
					icon: '\ue70b',
					text: '全部',
					path: '/pages/navigation/tabbar/index4'
				}
			]
		},
		mapColorStr: {
			primary: 'primary',
			info: 'info',
			success: 'success',
			warning: 'warning',
			error: 'error'
		},
		mapColor: {
			primary: '#2d8cf0',
			info: '#2db7f5',
			success: '#00c28b',
			warning: '#ffbb1e',
			error: '#ff6943'
		},
	},
	methods: {
		setTabBarBadge({index, text, dot}){
			this.tabbar.items[index].badge = text
			this.tabbar.items[index].dot = dot
		}
	},
	getSystemInfo(){
		// 设置系统信息
		// 微信端需另外设置导航头部信息
		let systemInfo = uni.getSystemInfoSync()
		// 头部原生导航或自定义导航高度，包含状态栏高度
		systemInfo.navHeight = systemInfo.windowTop || 44
		// #ifdef MP-WEIXIN
		// 获取胶囊按钮信息
		let menuRect = wx.getMenuButtonBoundingClientRect()
		// 获取头部导航高度
		systemInfo.windowTop = (parseInt(menuRect.top) - systemInfo.statusBarHeight) * 2 + menuRect.height
		systemInfo.windowBottom = systemInfo.screenHeight - systemInfo.windowHeight - systemInfo.windowTop - systemInfo.statusBarHeight
		systemInfo.navHeight += systemInfo.statusBarHeight
		// #endif
		return systemInfo
	}
}